﻿Imports Microsoft.VisualBasic
Imports System.Data.SqlClient
Imports System.Data


Public Class feature

#Region "Properties"

    Private _featureId As Integer
    Public Property FeatureId() As Integer
        Get
            Return _featureId
        End Get
        Set(ByVal value As Integer)
            _featureId = value
        End Set
    End Property

    Private _name As String
    Public Property Name() As String
        Get
            Return _name
        End Get
        Set(ByVal value As String)
            _name = value
        End Set
    End Property

    Private _userStory As String
    Public Property UserStory() As String
        Get
            Return _userStory
        End Get
        Set(ByVal value As String)
            _userStory = value
        End Set
    End Property

    Private _projectID As Integer
    Public Property ProjectID() As Integer
        Get
            Return _projectID
        End Get
        Set(ByVal value As Integer)
            _projectID = value
        End Set
    End Property

    Private _priority As Integer
    Public Property Priority() As Integer
        Get
            Return _priority
        End Get
        Set(ByVal value As Integer)
            _priority = value
        End Set
    End Property



#End Region

#Region "Methods"

    Dim _dal As New ScrumrData

    Public Sub AddFeature(ByVal sProjectId As Integer, ByVal sFeatureName As String, ByVal sFeatureStory As String, ByVal iFeaturePriority As Integer)

        Me.ProjectID = sProjectId
        Me.Name = sFeatureName
        Me.UserStory = sFeatureStory
        Me.Priority = iFeaturePriority

        Try
            Me.FeatureId = _dal.SaveFeature(Me.ProjectID, Me.Name, Me.UserStory, Me.Priority)
        Catch ex As Exception
            Throw New Exception("Business layer error: " & ex.Message)
        End Try


    End Sub

#End Region
End Class

